import hilog from '@ohos.hilog';

export class JsLogger {
  private domain: number;
  private tag: string;

  constructor(tag: string) {
    this.tag = tag;
    this.domain = 0xFF00;
  }

  debug(format: string, ...args: any[]): void {
    hilog.debug(this.domain, this.tag, format, args);
  }

  info(format: string, ...args: any[]): void {
    hilog.info(this.domain, this.tag, format, args);
  }

  warn(format: string, ...args: any[]): void {
    hilog.warn(this.domain, this.tag, format, args);
  }

  error(format: string, ...args: any[]): void {
    hilog.error(this.domain, this.tag, format, args);
  }

  fatal(format: string, ...args: any[]): void {
    hilog.fatal(this.domain, this.tag, format, args);
  }

  isLoggable(level: number): void {
    hilog.isLoggable(this.domain, this.tag, level);
  }
}

export default new JsLogger('QtForHarmony');

